package com.hystrix.bootstrap;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

@ComponentScan(value = {"com.hystrix.controller","com.hystrix.service","com.hystrix.requestmerge"})
@EnableHystrixDashboard
@EnableDiscoveryClient
@SpringCloudApplication
public class HystrixConsumerApplication {

    public static void main(String[] args){
        SpringApplication.run(HystrixConsumerApplication.class,args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
